
<?php if(!empty($data)): ?>
<?php $cate = $this->config->item('categories'); ?>
<?php $permalink = '';$shareLink = '';$arrUri = array(); ?>
<?php foreach($data as $post): ?>
<?php if($post->category_id == 2 && trim($post->video_code) == '') continue; ?>
<?php $permalink = permalink(array('text' => $post->post_title, 'id' => $post->id));$indicator = '';$shareLink = urlencode($permalink); ?>
<?php
$arrUri[] = $permalink;
?>

	<!--begin article-->
	<article data-entry-id="<?php echo $post->id ?>" data-entry-thumbnail-url="photo/<?php echo $post->id ?>_220x145.jpg" data-entry-url="<?php echo $permalink ?>" data-entry-votes="6513" data-entry-comments="9" id="jsid-entry-entity-<?php echo $post->id ?>" class="badge-entry-container badge-entry-entity">
		<header>
			<h2 class="badge-item-title">
				<a class="badge-evt badge-track" data-evt="ref-post-from-list,hot,position-1" data-track="post,v,,,d,<?php echo $post->id ?>,l" href="<?php echo $permalink ?>" target="_blank">
				<?php echo $post->post_title ?>
				</a>
			</h2>			
			<div class="float-vote-shadow badge-entry-sticky-shadow">
				<div class="badge-entry-sticky">
					<div class="float-vote-2">
						<ul class="badge-item-vote-container  ">
							<li>
								<a class="badge-item-vote-up display good" href="javascript:void(0);">
								<span class="icon"></span>
								</a>
							</li>
							<li class="count"><span id="love-count-<?php echo $post->id ?>" class="badge-item-love-count">
								<div class="fb-like" data-href="<?php echo $permalink; ?>" data-width="The pixel width of the plugin" data-height="The pixel height of the plugin" data-colorscheme="light" data-layout="box_count" data-action="like" data-show-faces="false" data-send="false"></div>
							</span></li>
							<li>
								<a class="badge-item-vote-down display meh" href="javascript:void(0);">
								<span class="icon"></span>
								</a>
							</li>
						</ul>
					</div>
				</div>
			</div>			
		</header>
		<?php if($post->item_type == 'video'){
					$indicator = 'video-post';
		        }
		        elseif($post->item_type == 'gif'){
		        	$indicator = 'gif-post';
		        }
		        else{
		        	$indicator = '';
		        }
		        ?>
		<div class="badge-post-container post-container <?php echo $indicator; ?>">
			<a href="<?php echo $permalink ?>"  target="_blank" class="badge-track badge-track-no-follow" data-track="post,c,,,d,<?php echo $post->id ?>,l">
				<img class="badge-item-img" src="<?php echo getThumbnail('460x460', $post->post_image) ?>" alt="<?php echo $post->post_title ?>">
				<?php if($post->item_type == 'gif' || $post->item_type == 'video'):?>
					<span class="play">Play</span>
					<?php endif; ?>
					<?php if($indicator == 'gif-post'): ?>
					<div class="badge-animated-container-animated hide">
			            <img alt="<?php echo $post->post_title ?>" src="<?php echo getImage($post->post_image) ?>" class="badge-item-animated-img">
			        </div>
			        <?php else: ?>
				    	<div class="badge-animated-container-animated hide">
				            <iframe width="460" height="345" src="//www.youtube.com/embed/<?php echo youtubeVideoExtractor($post->video_code) ?>?rel=0" frameborder="0" allowfullscreen></iframe>
				        </div>
			    <?php endif; ?>
			</a>
		</div>
		<div class="post-afterbar in-list-view">
			<div class="share">
				<div class="share">
					<div class="share-count"><p>TOP<br />TATTOOS</p></div>
					<ul>
						<li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $shareLink; ?>" title="Chia sẻ lên facebook" target="_blank" class="badge-facebook-share badge-evt badge-track facebook"><span>Share on Facebook</span></a></li>
			            <li><a title="Đăng lên Google+" target="_blank" href="https://plus.google.com/share?url=<?php echo $shareLink; ?>" class="badge-gplus-share badge-evt badge-track google-plus">Share on Google+</a> </li>
			            <li><a title="Gửi lên Twitter" href="https://twitter.com/share?url=<?php echo $shareLink; ?>" target="_blank" class="badge-twitter-share badge-evt badge-track twitter">Tweet this</a> </li>
			            <li><a title="Pin lên Pinterest" target="_blank" href="//www.pinterest.com/pin/create/button/?url=<?php echo $shareLink; ?>&media=<?php echo urlencode(getThumbnail('460x460', $post->post_image)); ?>" class="badge-pinterest-share badge-evt badge-track pinterest">Pin it</a> </li>
					</ul>
				</div>
			</div>
		</div>
	</article>
	<?php endforeach; ?>
<?php endif; ?>
